#include<iostream>
using namespace std;
int Nixu(int arr[], int n)
{
	int left = 0;
	int right = n - 1;
	int count = 0;
	while (left != right)
	{
		if (arr[left] > arr[right])
		{
			count++;
		}
		right--;
	}
}
int main()
{
	int arr[101];
	int n;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
	}
	int ret = Nixu(arr, n);
	cout << ret << endl;
	return 0;
}